import QtQuick 2.15
import QtQuick.Controls 2.15


Item {
    property real showWidth
    property real showHeight
    property string printData : showText.text
    property real maxShowLength

    Rectangle{
        width: showWidth
        height: showHeight
        // border.width: 1
        radius: 5

        Text{
            id:showText
            anchors.centerIn: parent
            font.pixelSize: 30
            font.bold: true
            visible: true
        }

        TextInput{
            id:showTextInput
            anchors.centerIn: parent
            font.pixelSize: 30
            maximumLength: maxShowLength
            font.bold: true
            visible: false

            onEditingFinished: {
                showText.text = showTextInput.text
                showText.visible = true
                showTextInput.visible = false
            }
        }

        MouseArea{
            anchors.fill: parent

            onClicked: {
                showTextInput.text = showText.text
                showText.visible = false
                showTextInput.visible = true
                showTextInput.forceActiveFocus()
            }
        }

    }
}
